3.19. MPI Type indexed can be used to build a derived datatype from arbitrary array elements. Its syntax is ![]() Unlike MPI Type create struct, the displacements are measured in units of old mpi t-not bytes. Use MPI Type indexed to create a derived datatype that corresponds to the upper triangular part of a square matrix. For example, in the 4x4 matrix ![]() the upper triangular part is the elements 0, 1, 2, 3, 5, 6, 7, 10,11, 15. Process 0 should read in an nxn matrix as a one-dimensional array, create the derived datatype, and send the upper triangular part with a single call to MPI Send. Process 1 should receive the upper triangular part with a single call to MPI Recv and then print the data it received. | |
| View Solution | |
| << Back | Next >> |